Video coding is an essential technology, used in applications from digital televisions to video streaming. H.264 is a standard that was first proposed in 2003, and evolved to transmit high quality, high definition video at low bit rates. Its high performance and adaptability for many applications has placed it at the forefront of current coding technology.
H.264 is able to perform almost lossless compression by taking advantage of Variable Length Coding (VLC) and Context Adaptive Binary Arithmetic Coding (CABAC) which can render information digitally at low bit rates. CABAC transforms data into bits, encodes them as binary symbols, and applies multiple probability models to the binary symbols which are selected adaptively. A number of binarization techniques can be used. Unary binarization is a technique which converts a codeword into a string of ONES followed by a terminating ZERO. Alternatively, Unary binarization technique can be a processing which converts a codeword into a string of ZEROS followed by a terminating ONE. This has the advantage of making each codeword uniquely distinguishable but larger codewords will be very long, as the number of bins depends on the size of the largest value. An alternative binarization method is Exponential-Golomb (exp-Golomb) binarization wherein a codeword is split into a unary prefix and a binary suffix. This form of binarization reduces the number of bins which need to be sent through a binary arithmetic coder (BAC), but has the disadvantage of being unable to quickly distinguish between smaller and larger codewords.
A concatenated unary/k-th order Exp-Golomb code (UEGK) has therefore been developed for H.264, which combines the advantages of both unary and Exp-Golomb binarization methods. Below a certain threshold, a bin string for a codeword N is formed by a unary code consisting of a series of N−1 ONES terminated with a ZERO. At and above the threshold, a bin string is formed by a truncated unary prefix consisting of a series of ONES and followed by a k-th order Exp-Golomb suffix. The prefix is made up of a first portion of a bin string. The suffix is made up of a second portion and a third portion, where the second portion is a series of ONES terminated with a ZERO, and the third portion is a binary value consisting of a number of bits. For k-th order Exp-Golomb suffix, if the number of ONES in second pattern is P, then the binary value in third portion consists of (P+k) bits.
Please refer to FIG. 1, which illustrates an UEG0 bin string table for a UEGK of 0-th order code used for the syntax element coeff_abs_level_minus1 (i.e., |transform coefficient level|−1; the “abs_level” shown in the figure is equal to coeff_abs_level_minus1+1) in H.264 and MPEG-4. As shown in the table, the threshold at which the codewords will be formed with a suffix is 15. In other words, when N (abs_level) is less than 15, the codewords will be formed by a unary code consisting of a series of N−1 ONES terminated with a ZERO, and when N is greater than or equal to 15, the codewords will be formed by a truncated unary prefix (first portion) with an Exp-Golomb (EG) suffix consisting a second portion and a third portion. The codewords can therefore be divided into Type 1 codewords (N is less than 15) and Type 2 codewords (N is greater than or equal to 15).
A conventional method of de-binarizing a bin string coded with the UEGk binarization scheme is to decode each portion of the codeword separately, thereby obtaining three respective index values, and then adding all three index values together. An example of this is described herein. When a codeword is Type 2, the first portion has a defined number of ONES which enables the first index value to be directly derived. The number of ONES in the second portion can be counted to derive the second index value. The number of ONES in the second portion also indicates how many bits make up the third portion, for example, the number of ONES in the second portion is the same as the number of bits in the third portion in UEG0 (Unary 0th order Exp-Golomb code) bin strings. These bits of third portion will then be used to derive the third index value. The value of the syntax element represented by the UEGK bin string can be calculated by summing the first index value, second index value, and the third index value.
As the conventional method typically requires two adders for decoding the codewords, a certain amount of hardware is required. This may have a negative effect on the timing path in hardware design. It is therefore an objective of the present invention to provide a simpler and more efficient method of decoding codewords which are binarized using a UEGK scheme.